package com.ccc.dao.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.ccc.dao.ManagerDao;
import com.ccc.model.Manager;
import com.ccc.util.dao.UtilDao;

@Component("managerDao")
public class ManagerDaoImpl implements ManagerDao {
	private UtilDao utilDao;

	@Override
	public void addManager(Manager manager) {
		utilDao.save(manager);
	}

	@Override
	public void deleteManager(Manager manager) {
		utilDao.delete(manager);
	}

	@Override
	public void updateManager(Manager manager) {
		utilDao.update(manager);
	}

	@Override
	public Manager findManager(int id) {
		return utilDao.find(Manager.class, id);
	}
	
	@Override
	public List<Manager> findManager(String sql,Object[] o){
		return utilDao.find(sql, o);
	}

	public UtilDao getUtilDao() {
		return utilDao;
	}

	@Resource
	public void setUtilDao(UtilDao utilDao) {
		this.utilDao = utilDao;
	}

}
